home *** CD-ROM | disk | FTP | other *** search
/ Cracking 2 / Cracking II..iso / Texty / crackme / ptg.txt < prev    next >
Encoding:
Text File  |  2000-01-24  |  11.1 KB  |  222 lines

  1. How to crack R!SC's Play The Game CD-Check Crackme by Killer_3K [DSi/Shock]
  2.  
  3. grab it at E_Bliss's crackme page (crackmes.cjb.net)
  4. Tools: Sice&a mempatcher (i use R!SC's process patcher ;p)
  5.  
  6. hey there, in this tut i'll teach u how to crack risc's PTG (play the game)
  7. CD-Check crackme. This Crackme is pretty nice, it detects sice (via int68),
  8. sorta hidden crc-check, packed, fake conditional jumps that leads to crash
  9. and more interesting stuff ;p
  10. btw, don't bather unpacking it (it's packed w/ upx), as the readme says that
  11. ur not allowed to unpack in order to patch, it doesn't really matter anywayz,
  12. cause the way he fucked around w/ it about 96% of the code u'll get after dasm
  13. will be garbadge :P
  14.  
  15. ok lets get started :)
  16. fireup the crackme.. Doh, we get a msgbox saying "Kill Softice Mr. Cracker"
  17. ok lets get rid of it :) since the first time i got that crackme i didn't
  18. know how it detected it, so i'll tell u how i figured out how to kill the sice
  19. w/o knowing it uses int68 :)
  20.  
  21. 1) bpx on GetModuleHandleA and run the crackme, sice pops, but we see Explorer
  22. in the down-right corner, we don't want Explorer now do we :) Press F5 again
  23. till u see 'Play the' in the down-left corner, ok, press F11 and start tracing :)
  24. u should see this:
  25.  
  26. 0177:00401143  68F0104000          PUSH      004010F0
  27. 0177:00401148  50                  PUSH      EAX
  28. 0177:00401149  E818060000          CALL      KERNEL32!GetProcAddress
  29. 0177:0040114E  A3B2204000          MOV       [004020B2],EAX
  30. 0177:00401153  33C0                XOR       EAX,EAX
  31. 0177:00401155  7533                JNZ       0040118A
  32. 0177:00401157  3BF6                CMP       ESI,ESI
  33. 0177:00401159  68E7104000          PUSH      004010E7
  34. 0177:0040115E  E80F060000          CALL      KERNEL32!GetModuleHandleA
  35. 0177:00401163  68FE104000          PUSH      004010FE
  36. 0177:00401168  50                  PUSH      EAX
  37. 0177:00401169  3BF6                CMP       ESI,ESI
  38. 0177:0040116B  E8F6050000          CALL      KERNEL32!GetProcAddress
  39. 0177:00401170  A3B2204000          MOV       [004020B2],EAX
  40.  
  41. ..
  42. ok, lets trace abit till we pass
  43.  
  44. 0177:00401168  50                  PUSH      EAX
  45. 0177:00401169  3BF6                CMP       ESI,ESI
  46. 0177:0040116B  E8F6050000          CALL      KERNEL32!GetProcAddress
  47. 0177:00401170  A3B2204000          MOV       [KERNEL32!AddAtomW],EAX
  48. 0177:00401175  C70530204000433A2F00MOV       DWORD PTR [00402030],002F3A43
  49.  
  50. 0177:0040117F  688A114000          PUSH      0040118A
  51. 0177:00401184  FF2507214000        JMP       [00402107] <<---
  52.  
  53. ok, lets trace and pass the jmp
  54. u should now see this:
  55.  
  56. 0177:00401442  33D2                XOR       EDX,EDX
  57. 0177:00401444  3BF6                CMP       ESI,ESI
  58. 0177:00401446  7401                JZ        00401449
  59. 0177:00401448  BD686C1440          MOV       EBP,40146C68
  60. . and some junk code after it
  61. the jz is gonna jump, let it jump, or else the proggi will crash :]
  62.  
  63. after the jz is taken, the code changed abit, and will change abit after
  64. couple of lines u trace.. u should now see this (maybe it will change abit
  65. during tracing :)):
  66.  
  67. 0177:00401449  686C144000          PUSH      0040146C <-- will change to Add [edx], BH after we traced it
  68. 0177:0040144E  3AC0                CMP       AL,AL <-- will change to INVALID after we traced it
  69. 0177:00401450  7401                JZ        00401453
  70. .
  71.  
  72. ok this jz must be taken as well, or proggi will crash :)
  73. after it comes an interesting piece of code (which change after u trace):
  74.  
  75. 0177:00401453  64FF32              PUSH      DWORD PTR FS:[EDX]
  76. 0177:00401456  8925A9204000        MOV       [004020A9],ESP
  77. 0177:0040145C  892DAD204000        MOV       [004020AD],EBP
  78. 0177:00401462  648922              MOV       FS:[EDX],ESP
  79. 0177:00401465  3ADB                CMP       BL,BL
  80. 0177:00401467  7401                JZ        0040146A                (JUMP )
  81.  
  82. hmm the jz wants to jump here too (i wonder why ;) (note the cmp bl,bl))
  83. this time we don't have to make it jump, nop it or patch it to 7400 and the anti-sice
  84. is gone (btw u gotta patch it, as the crackme executes that piece of code over and over..)
  85. ok, ur prolly wondering why it doesn't detect sice now.. welp that jz leads us to the
  86. is_sice_there routine..
  87. lets take a look at that routine
  88. after u'll take the jz u'll reach
  89. 0177:0040146A  EB20                JMP       0040148C
  90.  
  91. which will lead us to a VERY interesting piece of code (will keep changing during tracing):
  92.  
  93. 0177:0040148C  663BF6              CMP       SI,SI
  94. 0177:0040148F  7401                JZ        00401492 (jump)  <<
  95. 0177:00401492  B443                MOV       AH,43 ; move 0x43 to AH
  96. 0177:00401494  CD68                INT       68 ; int68 (no shit ;))
  97. 0177:00401496  5A                  POP       EDX
  98. 0177:00401497  3BD2                CMP       EDX,EDX
  99. 0177:00401499  7401                JZ        0040149C  (jump) <<
  100. 0177:0040149C  646789160000        MOV       FS:[0000],EDX
  101. 0177:004014A2  3BF6                CMP       ESI,ESI
  102. 0177:004014A4  7401                JZ        004014A7  (jump) <<
  103. 0177:004014A7  5A                  POP       EDX
  104. 0177:004014A8  3BD2                CMP       EDX,EDX
  105. 0177:004014AA  7401                JZ        004014AD  (jump) <<
  106. 0177:004014AD  663D86F3            CMP       AX,F386 !!!
  107. 0177:004014B1  58                  POP       EAX
  108. 0177:004014B2  7402                JZ        004014B6  (jump) <<<
  109.  
  110.  
  111. now, this is the anti-ice part :) u can nop ANY jz from 40148F until 4014B2, and it will kill
  112. the anti-ice, another way to kill it will be nopping the INT 68, anyway will fit here :)
  113.  
  114. if u'll keep tracing after 4014B2 w/o touching the jumps/int68 u'll reach this piece of code:
  115.  
  116. 0177:004014B8  7401                JZ        004014BB  (JUMP)
  117. 0177:004014B6  3BF6                CMP       ESI,ESI
  118. 0177:004014BB  68A5104000          PUSH      004010A5
  119. 0177:004014C0  C3                  RET
  120. which will lead u to:
  121. 0177:004014C1  E85F020000          CALL      00401725
  122. 0177:004010A5  6A00                PUSH      00
  123. 0177:004010A7  6897104000          PUSH      00401097 ; title (type d 401097 in sice and u'll see doh! in widechar)
  124. 0177:004010AC  6863104000          PUSH      00401063 ; msg (type d 401063 in sice an u'll see Load anti-ice.. in widechar)
  125. 0177:004010B1  6A00                PUSH      00
  126. 0177:004010B3  E8A8060000          CALL      USER32!MessageBoxW ; msgbox
  127. 0177:004010B8  6A00                PUSH      00
  128. 0177:004010BA  E8B9060000          CALL      KERNEL32!ExitProcess ; exit proggi
  129.  
  130. anywayz if u'll patch like i showed u above we'll never reach that place :)
  131. ok, to make it ez on urself, make a mempatcher to patch the anti-ice (i used R!SC's Process Patcher :))
  132.  
  133. 2) ok, now we can get to the real part of the protection, run ur loader (which will load&patch the exe :))
  134. u'll see:
  135. 'No Disk inserted' (if ur cd-drive is empty) or 'Wrong disk inserted' (if u got a cd in ur drive)
  136. ok, lets kill that lovely cdcheck :)
  137. put a bpx on getdrivetypea and run the proggi, u should see this:
  138.  
  139. 0177:004011A5  FF15B2204000        CALL      [KERNEL32!GetDriveTypeA]
  140. 0177:004011AB  83F805              CMP       EAX,05 <-- !!
  141. 0177:004011AE  75DA                JNZ       0040118A
  142.  
  143. ok, this part checks to see if a drive is a cddrive (if it is, eax=5),
  144. change it to CMP EAX,03 so it will think HDD=cddrive
  145. type bc* and bpx on GetVolumeInformationA, sice will break, press F11, u'll see:
  146.  
  147. 0177:004011F7  3BDB                CMP       EBX,EBX  ; compare ebx w/ ebx heh
  148. 0177:004011F9  7401                JZ        004011FC ; obviously a fake coditional jump
  149. 0177:004011FC  FE05B1204000        INC       BYTE PTR [004020B1]
  150. 0177:00401202  85C0                TEST      EAX,EAX
  151. 0177:00401204  0F847D000000        JZ        00401287  (won't jump)
  152. 0177:0040120B  BE59204000          MOV       ESI,00402059
  153. 0177:00401210  BF2F114000          MOV       EDI,0040112F
  154. 0177:00401215  B907000000          MOV       ECX,00000007
  155. 0177:0040121A  F3A6                REPZ CMPSB ; compare labels (good label on edi, label from hdd on esi)
  156. 0177:0040121C  755D                JNZ       0040127B ; label's rn't the same, goto badboy (will push the Wrong disk text)
  157. 0177:0040121E  E9B8000000          JMP       004012DB ; this will leads to the 'goodboy' part, and then creates the dialog
  158.  
  159. 3) ok, we patched CMP EAX,05 to CMP EAX,03, and nopped JNZ 40127B (or just patched it to 7500 which will make it jump to the next byte)
  160. ok, type bc* and press F5.. WTF?! 'Try harder!! You WILL crackme!'
  161. checksum.. hmm, ok update the mempatcher w/ the cdcheck, and lets get ready to kill that checksum
  162. put back that bpx on GetDriveTypeA, ok sice breaks, the CMP EAX,05 should be patched, if not the patch it w/ sice
  163. type BC* and then type BPM 004011AB R, this will make sice break when the crackme will try to read that addi
  164. press F5.. Boom, sice breaks, the proggi is trying the read the part, i wonder why ;)
  165. u should see this piece of code:
  166.  
  167. 0177:004014F9  3AC0                CMP       AL,AL
  168. 0177:004014FB  7401                JZ        004014FE ; fake conditional jump
  169. 0177:004014FE  03040E              ADD       EAX,[ECX+ESI] <-- add the byte located in Current Location+Counter to EAX
  170. 0177:00401501  663BF6              CMP       SI,SI <<--- u start here
  171. 0177:00401504  7401                JZ        00401507  ; fake conditinal jump
  172. 0177:00401507  49                  DEC       ECX ; decrease counter
  173. 0177:00401508  75EF                JNZ       004014F9 ; are we done? if no then do the whole thing again
  174. as u can see this basicly reads a byte located 4014FE + Counter, adds it to eax
  175. and does it till counter = 0
  176.  
  177. ok, to make it abit faster, type bc*, and bpx on 40150A, and press F5
  178. u'll reach this VERY interesting piece of code:
  179.  
  180. 0177:0040150A  59                  POP       ECX
  181. 0177:0040150B  5E                  POP       ESI
  182. 0177:0040150C  663BFF              CMP       DI,DI
  183. 0177:0040150F  7401                JZ        00401512  (jump) ; fake conditional
  184. 0177:00401512  3D31B88FE0          CMP       EAX,E08FB831 ; compare result of the checksum w/ a hardcoded result (which is correct one)
  185. 0177:00401517  7543                JNZ       0040155C ; << results rn't the same, BADBOY ;p
  186. 0177:00401519  3AD2                CMP       DL,DL
  187. 0177:0040151B  7401                JZ        0040151E ; fake conditonal (which will change the code below to RET)
  188. 0177:0040151E  C3                  RET  ; we're done, no harm was been done ;)
  189.  
  190. weee!
  191. just np the JNZ at 401517 (or patch it to 7500)
  192. and we're doneeeeeeeeeeeeeeeeeeeeeeeeeeeeeee! :)
  193.  
  194. i hope u enjoyed reading this tut and that u learned something new :)
  195. heres my mempatch script (compile w/ R!SC's process patcher ;p)
  196.  
  197. ----------------------cut here-------------------
  198. T=60000:
  199. f=Playth~1.exe:         ; filename
  200. o=PTG_loader.exe:     ; loader to create
  201. p=401467/74,01/74,00:    ;da anti-ice
  202. p=4011AB/83,F8,05/83,F8,03:  ; make the crackme think hdd=cdrom
  203. p=40121C/75,5D/75,00:  ; DriveVolume Check
  204. p=401517/75,43/75,00:  ; did i fuck around w/ the cd check? sure i didn't ;)
  205. $
  206. ----------------------cut here-------------------
  207.  
  208.  
  209. Greetings to (no specific order): R!SC, Acid_Burn, AB4DS, Kathras, Whizkid, Ordoc,
  210. Aerosmith, primevil, Senat0r, Cyclonex, Coffee, TORN@DO.
  211.  
  212. Also a SPECIAL-u-r-a-piece-of-shit-lamer goes to: Wekeke (aka Loko-Man)
  213. thx for all the funny logs *g*
  214.  
  215. Welp, thats about it ;p if i forgot ur name then don't get pissed, i sorta wrote
  216. that part in a hurry ;p
  217. Cya all :)
  218.  
  219.  
  220.  
  221.  
  222.                                   -Killer_3K [DSi/Shock]